// 2269. 找到一个数字的 K 美丽值
// AC: https://leetcode.cn/problems/find-the-k-beauty-of-a-number/submissions/610834938/

class Solution {
public:
    int divisorSubstrings(int num, int k) {
        int n=num;
        long long m=pow(10,k-1);
        int ans=0;
        while(n>=m){
            int x=n%(m*10);
            if(x!=0&&num%x==0)
                ans++;
            n/=10;
        }
        return ans;
    }
};